package com.guigu.yh.springcloud.controller;

import com.guigu.yh.springcloud.common.JsonResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

/**
 * 订单控制器
 *
 * @author 张颖辉（zyh）
 * @version 1.0.0
 * @date 2022/08/19
 */
@RestController
public class OrderController {

    private static final String INVOKE_URL = "http://cloud-provider-consul-payment";

    @Resource
    private RestTemplate restTemplate;

    @RequestMapping("consumer/consul")
    public JsonResult consulPayment() {
        return restTemplate.getForObject(INVOKE_URL+"/payment/consul", JsonResult.class);
    }

}
